Upgrade to ExtJS 3.0.0 - Released 07/06/2009
[extjs.git] / docs / source / reminder.html (Case Conflict 1)
diff --git a/docs/source/reminder.html (Case Conflict 1) b/docs/source/reminder.html (Case Conflict 1)
new file mode 100644 (file)
index 0000000..aaf9745
--- /dev/null
@@ -0,0 +1,41 @@
+<html>\r
+<head>\r
+  <title>The source code</title>\r
+    <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />\r
+    <script type="text/javascript" src="../resources/prettify/prettify.js"></script>\r
+</head>\r
+<body  onload="prettyPrint();">\r
+    <pre class="prettyprint lang-js">tx.ReminderManager = function(){\r
+       var table;\r
+       \r
+       var run = function(){\r
+               var rs = table.selectBy('where completed = 0 AND reminder <> \'\' AND reminder <= ?', [new Date()]);\r
+               for(var i = 0, len = rs.length; i < len; i++){\r
+                       showReminder.defer(10, window, [rs[i]]);\r
+               }       \r
+       };\r
+       \r
+       var showReminder = function(task){\r
+               var o;\r
+               if (o = tx.data.tasks.getById(task.taskId)) { // if currently loaded\r
+                       o.set('reminder', '');\r
+               }\r
+               else {   // else update db directly\r
+                       table.update({\r
+                               taskId: task.taskId,\r
+                               reminder: ''\r
+                       });\r
+               }\r
+               Ext.air.NativeWindowManager.getReminderWindow(task.taskId);\r
+       }\r
+       \r
+       return {\r
+               init : function(){\r
+                       table = tx.data.conn.getTable('task', 'taskId');\r
+                       setInterval(run, 10000);\r
+               }\r
+       }       \r
+}();\r
+</pre>    \r
+</body>\r
+</html>
\ No newline at end of file